/******************************************************************************/
/** \file os_types.h
 **
 ** os type common define.
 ** @link SampleGroup Some description @endlink
 **
 **   - 2020-11-07  1.0  LFZ First version.
 **
 ******************************************************************************/

#ifndef __OS_MUTEX_H__
#define __OS_MUTEX_H__

#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************/
/* Include files                                                             */
/*****************************************************************************/
#include "os_types.h"

#ifdef RT_THREAD_ENABLE
#include <rtthread.h>
typedef struct rt_mutex  os_mutex;
typedef struct rt_mutex *os_mutex_t;
#endif

BOOL os_mutex_init(os_mutex_t sem, const char *name);
BOOL os_mutex_detach(os_mutex_t sem);

os_mutex_t os_mutex_create(const char *name);
BOOL os_mutex_delete(os_mutex_t sem);

BOOL os_mutex_release(os_mutex_t sem);
BOOL os_mutex_take(os_mutex_t sem, int32_t timeout);

#ifdef __cplusplus  // close out "C" linkage in case of c++ compiling
}
#endif

#endif /* __OS_TYPES_H__ */

/******************************************************************************/
/* EOF (not truncated)                                                        */
/******************************************************************************/
